//
//  XMChatVoiceRecorder.h
//  XMJJ_zmy
//
//  Created by 丁浩 on 2025/7/5.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class XMChatVoiceRecorder;
@protocol XMChatVoiceRecorderDelegate <NSObject>

- (void)audioRecorder:(XMChatVoiceRecorder *)recorder didCheckPermission:(BOOL)isGranted isFirstTime:(BOOL)isFirstTime;
/// Power value can be used to simulate the animation of mic changes when speaking.
- (void)audioRecorder:(XMChatVoiceRecorder *)recorder didPowerChanged:(float)power;
- (void)audioRecorder:(XMChatVoiceRecorder *)recorder didRecordTimeChanged:(NSTimeInterval)time;

@end

@interface XMChatVoiceRecorder : NSObject

@property(nonatomic, weak) id<XMChatVoiceRecorderDelegate> delegate;

@property(nonatomic, copy, readonly) NSString *recordedFilePath;

- (void)record;
- (void)stop;
- (void)cancel;

@end

NS_ASSUME_NONNULL_END
